package listbyorder.access201_300.test283;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/6/28 13:47
 */
public class Solution1 {

    // 方法一；
    public void moveZeroes(int[] nums) {
        if (nums.length != 0) {
            int index = 0;
            for (int i = 0; i < nums.length; i++) {
                if (nums[i] != 0) {
                    nums[index++] = nums[i];
                }
            }
            for (int i = index; i < nums.length; i++) {
                nums[i] = 0;
            }
        }
    }

}
